<?php
include('../config.php');
header("Access-Control-Allow-Origin:*");

$phone = $_POST['phone'];
$goods_id = $_POST['goods_id'];

$sql = "delete from shop_car where phone='$phone' and goods_id=$goods_id ";
// $res时一个资源类型
$res = mysql_query($sql);


if ($res) {
    echo json_encode(array(
      "code" => 200,
      "body" => array(
        "msg" => '购物车删除成功'
      )
    ));
  } else {
    echo json_encode(array(
      "code" => 201,
      "body" => array(
        "msg" => '网络错误，请重试',
        "c"=>$phone,
        "v"=>$goods_id
      )
    ));
  }






?>